module(
    name = "cgrindel_bazel_starlib",
    version = "0.25.0",
    bazel_compatibility = [">=6.1.0"],
)

local_git_ext = use_extension("//tools/git:extensions.bzl", "local_git_ext")
use_repo(local_git_ext, "bazel_starlib_git_toolchains")

register_toolchains(
    "@bazel_starlib_git_toolchains//:local_git_toolchain",
)

# MARK: - Runtime Dependencies

bazel_dep(
    name = "rules_go",
    version = "0.50.1",
    repo_name = "io_bazel_rules_go",
)
bazel_dep(
    name = "gazelle",
    version = "0.40.0",
    repo_name = "bazel_gazelle",
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(
    name = "stardoc",
    version = "0.7.2",
    repo_name = "io_bazel_stardoc",
)
bazel_dep(
    name = "buildifier_prebuilt",
    version = "7.3.1",
)
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_shell", version = "0.3.0")
bazel_dep(name = "rules_multitool", version = "1.0.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")

multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
multitool.hub(lockfile = "//tools/gh:multitool.lock.json")
use_repo(multitool, "multitool")

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.3")

go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
    go_deps,
    "com_github_creasty_defaults",
    "com_github_gomarkdown_markdown",
    "com_github_stretchr_testify",
    "in_gopkg_yaml_v3",
)

# MARK: - Dev Dependencies

bazel_dep(
    name = "bazel_skylib_gazelle_plugin",
    version = "1.7.1",
    dev_dependency = True,
)
bazel_dep(
    name = "rules_bazel_integration_test",
    version = "0.32.0",
    dev_dependency = True,
)

bazel_binaries = use_extension(
    "@rules_bazel_integration_test//:extensions.bzl",
    "bazel_binaries",
    dev_dependency = True,
)
bazel_binaries.download(version_file = "//:.bazelversion")
bazel_binaries.download(version = "last_green")
use_repo(
    bazel_binaries,
    "bazel_binaries",
    "bazel_binaries_bazelisk",
    "build_bazel_bazel_.bazelversion",
    "build_bazel_bazel_last_green",
)
